#include <stdio.h>
int main(void)
{
    char pr_c = ' ';
    char now_c;
    int count = 0;

    while ((now_c = getchar()) != '#')
    {
        if (pr_c == 'e' && now_c == 'i')
            count++;
        pr_c = now_c;
    }
    printf("出现了%d次ei\n", count);
    
    return 0;
}